<template>
	<view class="container">
		<!-- 顶部信息栏 -->
		<view class="header">
			<view class="header-left">
				<view class="grade-badge" @click="gradeBounce">
					<text class="grade">二年级</text>
					<uni-icons type="medal" size="20" color="#FFD700"></uni-icons>
				</view>
				<view class="class-info">
					<text class="student-count">32名学生</text>
					<text class="class-name">阳光班</text>
				</view>
			</view>
			<view class="header-right">
				<view class="weather-card" @click="weatherBounce">
					<view class="weather-icon">
						<uni-icons type="partly-cloudy" size="28" color="#FFA726"></uni-icons>
					</view>
					<view class="weather-info">
						<text class="temperature">28°C</text>
						<text class="weather-desc">多云转晴</text>
					</view>
				</view>
				<view class="date-badge" @click="dateBounce">
					<text>{{currentDate}}</text>
				</view>
			</view>
		</view>

		<!-- 主要内容区 -->
		<view class="main-content">
			<!-- 第一行 -->
			<view class="row">

				<!-- 学生签到卡片 -->
				<view class="card attendance-card" @click="navigateTo('studentAttendance')"
					@touchstart="cardTouchStart('attendance')" @touchend="cardTouchEnd('attendance')"
					:style="{transform: cardScales.attendance}">
					<view class="card-header">
						<uni-icons type="contact" size="20" color="#5BD8A6"></uni-icons>
						<text class="card-title">学生签到</text>
						<view class="attendance-badge">{{attendanceRate}}%</view>
					</view>
					<view class="attendance-stats">
						<view class="stat-item" v-for="stat in attendanceStats" :key="stat.label"
							:style="{animationDelay: `${stat.delay}s`}">
							<text class="stat-value">{{stat.value}}</text>
							<text class="stat-label">{{stat.label}}</text>
							<view class="stat-trend" v-if="stat.trend">
								<uni-icons :type="stat.trend > 0 ? 'arrow-up' : 'arrow-down'" size="14"
									:color="stat.trend > 0 ? '#5BD8A6' : '#FF6B6B'"></uni-icons>
								<text>{{Math.abs(stat.trend)}}%</text>
							</view>
						</view>
					</view>
					<view class="progress-container">
						<view class="progress-bar">
							<view class="progress-fill" :style="{width: attendanceRate + '%'}"></view>
						</view>
						<text class="progress-text">{{attendanceRate}}%</text>
					</view>
					<view class="attendance-footer">
						<text>昨日出勤率 {{yesterdayRate}}%</text>
					</view>
				</view>

				<!-- 通知信息卡片 -->
				<view class="card notice-card" @click="navigateTo('notice')" @touchstart="cardTouchStart('notice')"
					@touchend="cardTouchEnd('notice')" :style="{transform: cardScales.notice}">
					<view class="card-header">
						<uni-icons type="notification" size="20" color="#5B8FF9"></uni-icons>
						<text class="card-title">通知信息</text>
						<view class="notice-badge">{{unreadNoticesCount}}</view>
					</view>
					<view class="notice-content">
						<view class="notice-item" v-for="(item, index) in notices" :key="index"
							:class="{unread: item.unread}" :style="{animationDelay: `${index*0.1}s`}">
							<view class="notice-time">{{item.time}}</view>
							<view class="notice-main">
								<uni-icons type="circle" size="12"
									:color="item.unread ? '#FF9900' : '#ccc'"></uni-icons>
								<text class="notice-text">{{item.content}}</text>
								<uni-icons v-if="item.unread" type="compose" size="14" color="#FF9900"></uni-icons>
							</view>
						</view>
					</view>
					<view class="card-footer">
						<text>滑动查看全部通知</text>
						<uni-icons type="arrow-right" size="16" color="#888"></uni-icons>
					</view>
				</view>

			</view>

			<!-- 第二行 -->
			<view class="row">
				<!-- 教师签到卡片 -->
				<view class="card teacher-card" @click="navigateTo('teacherAttendance')"
					@touchstart="cardTouchStart('teacher')" @touchend="cardTouchEnd('teacher')"
					:style="{transform: cardScales.teacher}">
					<view class="card-header">
						<uni-icons type="staff" size="20" color="#FF9D4D"></uni-icons>
						<text class="card-title">教师签到</text>
						<view class="teacher-summary">{{checkedInTeachersCount}}/{{teachers.length}} 已签到</view>
					</view>

					<!-- 可滚动区域 -->
					<scroll-view class="teacher-scroll" scroll-y>
						<view class="teacher-stats">
							<!-- 未打卡教师置顶 -->
							<view class="teacher-item" v-for="teacher in notCheckedInTeachers" :key="teacher.id"
								@touchstart="teacherTouchStart(teacher.id)" @touchend="teacherTouchEnd(teacher.id)"
								:style="{
				              transform: teacherScales[teacher.id],
				              background: 'rgba(255, 107, 107, 0.08)'
				            }">
								<image class="teacher-avatar" :src="teacher.avatar"></image>
								<view class="teacher-info">
									<text class="teacher-name">{{teacher.name}}</text>
									<text class="teacher-subject">{{teacher.subject}}</text>
								</view>
								<view class="teacher-status">
									<uni-icons type="close" size="16" color="#FF6B6B"></uni-icons>
									<text>未签到</text>
								</view>
								<view class="teacher-remind" @click.stop="remindTeacher(teacher.id)">
									<uni-icons type="notification-filled" size="16" color="#FF6B6B"></uni-icons>
								</view>
							</view>

							<!-- 已打卡教师按时间排序 -->
							<view class="teacher-item" v-for="teacher in checkedInTeachersByTime" :key="teacher.id"
								@touchstart="teacherTouchStart(teacher.id)" @touchend="teacherTouchEnd(teacher.id)"
								:style="{
				              transform: teacherScales[teacher.id],
				              background: 'rgba(91, 216, 166, 0.08)'
				            }">
								<image class="teacher-avatar" :src="teacher.avatar"></image>
								<view class="teacher-info">
									<text class="teacher-name">{{teacher.name}}</text>
									<text class="teacher-subject">{{teacher.subject}}</text>
								</view>
								<view class="teacher-status checked-in">
									<uni-icons type="checkmark" size="16" color="#5BD8A6"></uni-icons>
									<text>已签到</text>
								</view>
								<view class="teacher-time">
									<text>{{teacher.checkInTime}}</text>
								</view>
							</view>
						</view>
					</scroll-view>

					<!-- 滚动提示（当教师数量超过5个时显示） -->
					<view class="scroll-hint" v-if="teachers.length > 5">
						<uni-icons type="arrow-down" size="14" color="#888"></uni-icons>
						<text>上下滑动查看全部教师</text>
					</view>
				</view>

				<!-- 课程表卡片 -->
				<view class="card schedule-card" @click="navigateTo('schedule')"
					@touchstart="cardTouchStart('schedule')" @touchend="cardTouchEnd('schedule')"
					:style="{transform: cardScales.schedule}">
					<view class="card-header">
						<uni-icons type="calendar" size="20" color="#F766AD"></uni-icons>
						<text class="card-title">今日课程表</text>
						<view class="schedule-summary">共6节课</view>
					</view>

					<!-- 上午课程 - 横向排列 -->
					<view class="schedule-period">
						<text class="period-title">上午课程</text>
						<view class="courses-row morning-courses">
							<view class="course-item" v-for="(course, index) in morningCourses" :key="'morning-'+index"
								:style="{animationDelay: `${index*0.1}s`}">
								<view class="course-time">{{course.time}}</view>
								<text class="course-name">{{course.subject}}</text>
								<text class="course-teacher">{{course.teacher}}</text>
								<!-- <text class="course-location">{{course.location}}</text> -->
							</view>
						</view>
					</view>

					<!-- 下午课程 - 横向排列 -->
					<view class="schedule-period">
						<text class="period-title">下午课程</text>
						<view class="courses-row afternoon-courses">
							<view class="course-item" v-for="(course, index) in afternoonCourses"
								:key="'afternoon-'+index" :style="{animationDelay: `${index*0.1 + 0.3}s`}">
								<view class="course-time">{{course.time}}</view>
								<text class="course-name">{{course.subject}}</text>
								<text class="course-teacher">{{course.teacher}}</text>
								<!-- <text class="course-location">{{course.location}}</text> -->
							</view>
						</view>
					</view>

					<!-- 当前课程指示 -->
					<view class="current-course-indicator" v-if="currentCourse">
						<uni-icons type="notification" size="16" color="#F766AD"></uni-icons>
						<text>当前: {{currentCourse.subject}} ({{currentCourse.time}})</text>
					</view>
				</view>
			</view>

			<!-- 第三行 -->
			<view class="row">
				<!-- 积分统计卡片 -->
				<view class="card points-card" @click="navigateTo('points')" @touchstart="cardTouchStart('points')"
					@touchend="cardTouchEnd('points')" :style="{transform: cardScales.points}">
					<view class="card-header">
						<uni-icons type="star" size="20" color="#FFD166"></uni-icons>
						<text class="card-title">班级积分</text>
						<view class="points-summary">本周 +65</view>
					</view>
					<view class="points-total">
						<text class="points-value">+15</text>
						<text class="points-label">今日总加分</text>
					</view>
					<view class="points-chart">
						<qiun-data-charts type="line" :chartData="pointsChartData" :ontouch="true" />
					</view>
					<view class="points-breakdown">
						<view class="breakdown-item" v-for="item in pointsBreakdown" :key="item.type">
							<view class="breakdown-icon" :style="{background: item.color}">
								<uni-icons :type="item.icon" size="14" color="#fff"></uni-icons>
							</view>
							<text class="breakdown-type">{{item.type}}</text>
							<text class="breakdown-value">{{item.value}}</text>
						</view>
					</view>
				</view>

				<!-- 数据统计卡片 -->
				<view class="card stats-card" @click="navigateTo('stats')" @touchstart="cardTouchStart('stats')"
					@touchend="cardTouchEnd('stats')" :style="{transform: cardScales.stats}">
					<view class="card-header">
						<uni-icons type="star" size="20" color="#7D6BFF"></uni-icons>
						<text class="card-title">数据统计</text>
					</view>
					<view class="stats-content">
						<view class="stats-row">
							<!-- <view class="stats-chart">
								<qiun-data-charts type="arcbar" :chartData="attendanceChartData" />
								<text class="chart-title">出勤率</text>
							</view> -->
							<view class="stats-chart">
								<qiun-data-charts type="pie" :chartData="performanceChartData" />
								<text class="chart-title">分数分布图</text>
							</view>
						</view>
						<view class="stats-footer">
							<view class="stats-item">
								<text class="stats-value">120</text>
								<text class="stats-label">班级最高分</text>
							</view>
							<view class="stats-item">
								<text class="stats-value">48</text>
								<text class="stats-label">班级平均分</text>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				currentDate: this.formatDate(new Date()),
				notices: [{
						id: 1,
						content: "下周将进行期中测试，请同学们做好准备",
						time: "08:30",
						unread: true
					},
					{
						id: 2,
						content: "家长会定于周五下午2点，请家长准时参加",
						time: "昨天 15:45",
						unread: false
					},
				],
				teachers: [{
						id: 1,
						name: '张老师',
						subject: '数学',
						avatar: '/static/aver1.jpg',
						checkedIn: true,
						checkInTime: '08:15'
					},
					{
						id: 2,
						name: '李老师',
						subject: '语文',
						avatar: '/static/aver1.jpg',
						checkedIn: true,
						checkInTime: '08:05'
					},
					{
						id: 3,
						name: '王老师',
						subject: '英语',
						avatar: '/static/aver1.jpg',
						checkedIn: true,
						checkInTime: '07:55'
					},
					{
						id: 4,
						name: '赵老师',
						subject: '物理',
						avatar: '/static/aver1.jpg',
						checkedIn: false,
						checkInTime: ''
					},
					{
						id: 5,
						name: '刘老师',
						subject: '化学',
						avatar: '/static/aver1.jpg',
						checkedIn: false,
						checkInTime: ''
					},
					{
						id: 6,
						name: '赵老师',
						subject: '物理',
						avatar: '/static/aver1.jpg',
						checkedIn: false,
						checkInTime: ''
					},
					{
						id: 7,
						name: '刘老师',
						subject: '化学',
						avatar: '/static/aver1.jpg',
						checkedIn: false,
						checkInTime: ''
					}
				],
				morningCourses: [{
						time: '08:00-08:45',
						subject: '语文',
						teacher: '张老师',
						location: '201教室'
					},
					{
						time: '09:00-09:45',
						subject: '数学',
						teacher: '李老师',
						location: '202教室'
					},
					{
						time: '10:00-10:45',
						subject: '英语',
						teacher: '王老师',
						location: '203教室'
					}
				],
				afternoonCourses: [{
						time: '13:30-14:15',
						subject: '物理',
						teacher: '赵老师',
						location: '实验室'
					},
					{
						time: '14:30-15:15',
						subject: '化学',
						teacher: '刘老师',
						location: '实验室'
					},
					{
						time: '15:30-16:15',
						subject: '体育',
						teacher: '陈老师',
						location: '操场'
					}
				],
				currentCourse: {
					subject: '数学',
					teacher: '李老师',
					time: '09:00-09:45'
				},
				attendanceStats: [{
						label: '已到',
						value: 28,
						trend: 2,
						delay: 0.1
					},
					{
						label: '未到',
						value: 4,
						trend: -1,
						delay: 0.2
					},
					{
						label: '迟到',
						value: 2,
						trend: 0,
						delay: 0.3
					}
				],
				attendanceRate: 87.5,
				yesterdayRate: 85,
				pointsBreakdown: [{
						type: '语文',
						value: '+8',
						icon: 'hand-up',
						color: '#5B8FF9'
					},
					{
						type: '数学',
						value: '+5',
						icon: 'hand-up',
						color: '#5BD8A6'
					},
					{
						type: '英语',
						value: '+2',
						icon: 'hand-up',
						color: '#FF9D4D'
					}
				],
				cardScales: {
					notice: 'scale(1)',
					attendance: 'scale(1)',
					teacher: 'scale(1)',
					schedule: 'scale(1)',
					points: 'scale(1)',
					stats: 'scale(1)'
				},
				teacherScales: {
					1: 'scale(1)',
					2: 'scale(1)',
					3: 'scale(1)',
					4: 'scale(1)',
					5: 'scale(1)'
				},
				pointsChartData: {
					categories: ['周一', '周二', '周三', '周四', '周五'],
					series: [{
						name: '班级积分',
						data: [12, 15, 8, 20, 15],
						color: '#FFD166'
					}]
				},
				attendanceChartData: {
					series: [{
						name: '出勤率',
						data: 87.5,
						color: '#5BD8A6'
					}]
				},
				performanceChartData: {
					series: [{
						name: '70-90分',
						data: 15,
						color: '#5BD8A6'
					}, {
						name: '50-70分',
						data: 10,
						color: '#5B8FF9'
					}, {
						name: '30-50分',
						data: 5,
						color: '#FF9D4D'
					}, {
						name: '0-30分',
						data: 2,
						color: '#FF6B6B'
					}]
				}
			}
		},
		computed: {
			unreadNoticesCount() {
				return this.notices.filter(n => n.unread).length;
			},
			checkedInTeachersCount() {
				return this.teachers.filter(t => t.checkedIn).length;
			},
			notCheckedInTeachers() {
				return this.teachers.filter(t => !t.checkedIn);
			},
			checkedInTeachersByTime() {
				return this.teachers
					.filter(t => t.checkedIn)
					.sort((a, b) => a.checkInTime.localeCompare(b.checkInTime));
			}
		},
		onReady() {
			this.animateElements();
		},
		methods: {
			formatDate(date) {
				const year = date.getFullYear();
				const month = date.getMonth() + 1;
				const day = date.getDate();
				const week = ['日', '一', '二', '三', '四', '五', '六'][date.getDay()];
				return `${year}年${month}月${day}日 星期${week}`;
			},
			navigateTo(page) {
				uni.navigateTo({
					url: `/pages/${page}/${page}`
				});
			},
			cardTouchStart(type) {
				this.cardScales[type] = 'scale(0.98)';
			},
			cardTouchEnd(type) {
				this.cardScales[type] = 'scale(1)';
			},
			teacherTouchStart(id) {
				this.teacherScales[id] = 'scale(0.95)';
			},
			teacherTouchEnd(id) {
				this.teacherScales[id] = 'scale(1)';
			},
			remindTeacher(id) {
				uni.showToast({
					title: '已提醒教师签到',
					icon: 'none'
				});
			},
			gradeBounce() {
				this.$nextTick(() => {
					const el = uni.createSelectorQuery().select('.grade-badge');
					el.boundingClientRect(() => {
						uni.vibrateShort();
					}).exec();
				});
			},
			weatherBounce() {
				this.$nextTick(() => {
					const el = uni.createSelectorQuery().select('.weather-card');
					el.boundingClientRect(() => {
						uni.vibrateShort();
					}).exec();
				});
			},
			dateBounce() {
				this.$nextTick(() => {
					const el = uni.createSelectorQuery().select('.date-badge');
					el.boundingClientRect(() => {
						uni.vibrateShort();
					}).exec();
				});
			},
			animateElements() {
				// 卡片入场动画
				const cards = ['notice', 'attendance', 'teacher', 'schedule', 'points', 'stats'];
				cards.forEach((card, index) => {
					setTimeout(() => {
						this.cardScales[card] = 'scale(1) translateY(0)';
					}, index * 100);
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		display: flex;
		flex-direction: column;
		// height: 100vh;
		background-color: #f5f7fa;
		padding: 20px;
		box-sizing: border-box;
		// overflow: hidden;
	}

	/* 动画定义 */
	@keyframes fadeInUp {
		from {
			opacity: 0;
			transform: translateY(20px);
		}

		to {
			opacity: 1;
			transform: translateY(0);
		}
	}

	@keyframes bounce {

		0%,
		100% {
			transform: translateY(0);
		}

		50% {
			transform: translateY(-5px);
		}
	}

	@keyframes pulse {
		0% {
			transform: scale(1);
		}

		50% {
			transform: scale(1.05);
		}

		100% {
			transform: scale(1);
		}
	}

	.header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 20px;
		padding: 15px 20px;
		background: linear-gradient(135deg, #4ab8f7 0%, #9b25b2 100%);
		border-radius: 16px;
		color: white;
		box-shadow: 0 6px 16px rgba(37, 65, 178, 0.2);
		transform: translateY(0);
		transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);

		&:active {
			transform: translateY(2px);
		}

		.header-left {
			display: flex;
			align-items: center;

			.grade-badge {
				display: flex;
				align-items: center;
				background: rgba(255, 255, 255, 0.15);
				padding: 8px 12px;
				border-radius: 20px;
				margin-right: 15px;
				transform: scale(1);
				transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);

				&:active {
					transform: scale(0.95);
				}

				.grade {
					font-size: 20px;
					font-weight: bold;
					margin-right: 8px;
				}
			}

			.class-info {
				display: flex;
				flex-direction: column;

				.student-count {
					font-size: 14px;
					opacity: 0.9;
				}

				.class-name {
					font-size: 16px;
					font-weight: 500;
					margin-top: 4px;
				}
			}
		}

		.header-right {
			display: flex;
			align-items: center;

			.weather-card {
				display: flex;
				align-items: center;
				background: rgba(255, 255, 255, 0.15);
				padding: 8px 12px;
				border-radius: 20px;
				margin-right: 15px;
				transform: scale(1);
				transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);

				&:active {
					transform: scale(0.95);
				}

				.weather-icon {
					margin-right: 8px;
					animation: pulse 2s infinite;
				}

				.weather-info {
					display: flex;
					flex-direction: column;
					margin-right: 12px;

					.temperature {
						font-size: 18px;
						font-weight: bold;
					}

					.weather-desc {
						font-size: 12px;
					}
				}
			}

			.date-badge {
				background: rgba(255, 255, 255, 0.15);
				padding: 8px 12px;
				border-radius: 20px;
				font-size: 14px;
				transform: scale(1);
				transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);

				&:active {
					transform: scale(0.95);
				}
			}
		}
	}

	.main-content {
		flex: 1;
		display: flex;
		flex-direction: column;
	}

	.row {
		display: flex;
		margin-bottom: 20px;
		flex: 1;
		min-height: 0;

		&:last-child {
			margin-bottom: 0;
		}
	}

	.card {
		flex: 1;
		background: white;
		border-radius: 16px;
		padding: 16px;
		margin-right: 20px;
		box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
		display: flex;
		flex-direction: column;
		transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
		transform: scale(0.95) translateY(20px);
		opacity: 0;
		animation: fadeInUp 0.5s forwards;
		overflow: hidden;

		&:last-child {
			margin-right: 0;
		}

		.card-header {
			display: flex;
			align-items: center;
			margin-bottom: 12px;
			padding-bottom: 8px;
			border-bottom: 1px solid rgba(0, 0, 0, 0.05);
			position: relative;

			.card-title {
				font-size: 18px;
				font-weight: bold;
				margin-left: 8px;
			}

			.notice-badge,
			.attendance-badge,
			.teacher-summary,
			.schedule-summary,
			.points-summary {
				position: absolute;
				right: 0;
				background: rgba(0, 0, 0, 0.05);
				padding: 2px 8px;
				border-radius: 10px;
				font-size: 12px;
				font-weight: 500;
			}

			.notice-badge {
				background: #5B8FF9;
				color: white;
			}

			.attendance-badge {
				background: #5BD8A6;
				color: white;
			}

			.teacher-summary {
				background: #FF9D4D;
				color: white;
			}

			.schedule-summary {
				background: #F766AD;
				color: white;
			}

			.points-summary {
				background: #FFD166;
				color: white;
			}
		}

		.card-footer {
			margin-top: auto;
			padding-top: 8px;
			font-size: 14px;
			color: #888;
			display: flex;
			align-items: center;
			justify-content: flex-end;
		}
	}

	/* 通知卡片样式 */
	.notice-card {
		.notice-content {
			flex: 1;
			display: flex;
			flex-direction: column;
			padding: 8px 0;

			.notice-item {
				display: flex;
				flex-direction: column;
				padding: 10px 0;
				border-bottom: 1px dashed #eee;
				opacity: 0;
				animation: fadeInUp 0.5s forwards;

				&.unread {
					background: #fff8e6;
					border-left: 3px solid #FF9900;
					margin-left: -16px;
					padding-left: 13px;
					animation: bounce 1s infinite alternate, fadeInUp 0.5s forwards;
				}

				&:last-child {
					border-bottom: none;
				}

				.notice-time {
					font-size: 12px;
					color: #888;
					margin-bottom: 4px;
				}

				.notice-main {
					display: flex;
					align-items: center;

					.notice-text {
						font-size: 15px;
						margin-left: 8px;
						color: #555;
						flex: 1;
						line-height: 1.4;
					}
				}
			}
		}
	}

	/* 学生签到卡片样式 */
	.attendance-card {
		.attendance-stats {
			display: flex;
			justify-content: space-around;
			margin: 15px 0;

			.stat-item {
				display: flex;
				flex-direction: column;
				align-items: center;
				opacity: 0;
				animation: fadeInUp 0.5s forwards;

				.stat-value {
					font-size: 28px;
					font-weight: bold;
					color: #5BD8A6;
					margin-bottom: 4px;
				}

				.stat-label {
					font-size: 14px;
					color: #888;
					margin-bottom: 4px;
				}

				.stat-trend {
					display: flex;
					align-items: center;
					font-size: 12px;

					text {
						margin-left: 2px;
					}
				}
			}
		}

		.progress-container {
			display: flex;
			align-items: center;
			margin: 10px 0;

			.progress-bar {
				flex: 1;
				height: 8px;
				background: #f0f2f5;
				border-radius: 4px;
				overflow: hidden;
				margin-right: 10px;

				.progress-fill {
					height: 100%;
					background: linear-gradient(90deg, #5BD8A6, #4a6cf7);
					border-radius: 4px;
					transition: width 1s ease-out;
				}
			}

			.progress-text {
				font-size: 14px;
				font-weight: bold;
				color: #5BD8A6;
			}
		}

		.attendance-footer {
			font-size: 14px;
			color: #888;
			text-align: right;
		}
	}

	/* 教师签到卡片样式 */
	.teacher-card {
		.scroll-hint {
		    display: flex;
		    align-items: center;
		    justify-content: center;
		    padding: 8px;
		    font-size: 12px;
		    color: #888;
		    border-top: 1px dashed #eee;
		    
		    uni-icons {
		      margin-right: 5px;
		    }
		  }
		.teacher-scroll {
			height: calc(6 * 60px);
			/* 5个教师的高度 */
			overflow: hidden;

			.teacher-stats {
				flex: 1;
				display: flex;
				flex-direction: column;
				justify-content: space-around;

				.teacher-item {
					height: 60px;
					display: flex;
					align-items: center;
					padding: 12px;
					border-radius: 12px;
					margin-bottom: 8px;
					transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
					transform: scale(1);

					&:last-child {
						margin-bottom: 0;
					}

					.teacher-avatar {
						width: 40px;
						height: 40px;
						border-radius: 20px;
						margin-right: 12px;
						border: 2px solid white;
						box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
					}

					.teacher-info {
						flex: 1;
						display: flex;
						flex-direction: column;

						.teacher-name {
							font-size: 16px;
							font-weight: 500;
						}

						.teacher-subject {
							font-size: 12px;
							color: #888;
							margin-top: 2px;
						}
					}

					.teacher-status {
						display: flex;
						align-items: center;
						font-size: 14px;
						margin-right: 12px;

						text {
							margin-left: 4px;
						}

						&.checked-in {
							color: #5BD8A6;
						}
					}

					.teacher-remind {
						padding: 6px;
						border-radius: 50%;
						background: rgba(255, 107, 107, 0.1);
						display: flex;
						align-items: center;
						justify-content: center;
					}

					.teacher-time {
						font-size: 12px;
						color: #888;
					}
				}
			}
		}
	}

	/* 今日课程表卡片样式 */
	.schedule-card {
		.schedule-content {
			flex: 1;
			display: flex;
			flex-direction: column;
			padding: 8px 0;

			.schedule-columns {
				display: flex;
				flex: 1;

				.schedule-column {
					flex: 1;
					display: flex;
					flex-direction: column;
					padding: 0 8px;
					border-right: 1px dashed #eee;

					&:last-child {
						border-right: none;
					}

					.period-title {
						font-size: 14px;
						font-weight: 500;
						color: #F766AD;
						text-align: center;
						margin-bottom: 4px;
					}

					.period-time {
						font-size: 12px;
						color: #888;
						text-align: center;
						margin-bottom: 12px;
					}

					.course-item {
						background: rgba(247, 102, 173, 0.08);
						border-radius: 8px;
						padding: 10px;
						margin-bottom: 8px;
						opacity: 0;
						animation: fadeInUp 0.5s forwards;

						.course-name {
							font-size: 15px;
							font-weight: 500;
							display: block;
							margin-bottom: 4px;
						}

						.course-teacher {
							font-size: 12px;
							color: #888;
							display: block;
						}

						.course-location {
							font-size: 11px;
							color: #aaa;
							display: block;
							margin-top: 4px;
						}
					}

					.course-empty {
						font-size: 12px;
						color: #ccc;
						text-align: center;
						padding: 10px;
						margin-bottom: 8px;
					}
				}
			}
		}

		.current-course {
			background: rgba(247, 102, 173, 0.1);
			border-radius: 8px;
			padding: 10px;
			margin-top: 8px;
			display: flex;
			flex-direction: column;

			.current-label {
				font-size: 12px;
				color: #F766AD;
				margin-bottom: 4px;
			}

			.current-name {
				font-size: 15px;
				font-weight: 500;
			}

			.current-time {
				font-size: 12px;
				color: #888;
				margin-top: 4px;
			}
		}
	}

	/* 积分卡片样式 */
	.points-card {
		.points-total {
			display: flex;
			flex-direction: column;
			align-items: center;
			margin: 15px 0;
			opacity: 0;
			animation: fadeInUp 0.5s forwards;
			animation-delay: 0.2s;

			.points-value {
				font-size: 42px;
				font-weight: bold;
				color: #FFD166;
				text-shadow: 0 2px 4px rgba(255, 209, 102, 0.3);
			}

			.points-label {
				font-size: 16px;
				color: #888;
				margin-top: 4px;
			}
		}

		.points-chart {
			height: 120px;
			margin: 10px 0;
			opacity: 0;
			animation: fadeInUp 0.5s forwards;
			animation-delay: 0.3s;
		}

		.points-breakdown {
			display: flex;
			justify-content: space-around;
			margin-top: 10px;
			opacity: 0;
			animation: fadeInUp 0.5s forwards;
			animation-delay: 0.4s;

			.breakdown-item {
				display: flex;
				flex-direction: column;
				align-items: center;

				.breakdown-icon {
					width: 28px;
					height: 28px;
					border-radius: 14px;
					display: flex;
					align-items: center;
					justify-content: center;
					margin-bottom: 6px;
				}

				.breakdown-type {
					font-size: 12px;
					color: #888;
					margin-bottom: 2px;
				}

				.breakdown-value {
					font-size: 14px;
					font-weight: 500;
				}
			}
		}
	}

	.stats-card {
		.stats-content {
			flex: 1;
			display: flex;
			flex-direction: column;
		}

		.stats-row {
			display: flex;
			flex: 1;

			.stats-chart {
				flex: 1;
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;
				opacity: 0;
				animation: fadeInUp 0.5s forwards;

				.chart-title {
					font-size: 14px;
					color: #888;
					margin-top: 8px;
				}
			}
		}

		.stats-footer {
			display: flex;
			justify-content: space-around;
			margin-top: 10px;
			opacity: 0;
			animation: fadeInUp 0.5s forwards;
			animation-delay: 0.2s;

			.stats-item {
				display: flex;
				flex-direction: column;
				align-items: center;

				.stats-value {
					font-size: 24px;
					font-weight: bold;
					color: #7D6BFF;
				}

				.stats-label {
					font-size: 12px;
					color: #888;
				}
			}
		}
	}

	/* 响应式调整 */
	@media (max-width: 768px) {
		.row {
			flex-direction: column;
		}

		.card {
			margin-right: 0;
			margin-bottom: 20px;

			&:last-child {
				margin-bottom: 0;
			}
		}
	}

	/* 课程表卡片样式 - 横向排版 */
	.schedule-card {
		.schedule-period {
			margin-bottom: 15px;

			&:last-child {
				margin-bottom: 0;
			}

			.period-title {
				font-size: 15px;
				font-weight: bold;
				color: #F766AD;
				margin-bottom: 8px;
				display: flex;
				align-items: center;

				&::before {
					content: '';
					display: inline-block;
					width: 4px;
					height: 15px;
					background: #F766AD;
					border-radius: 2px;
					margin-right: 8px;
				}
			}

			.courses-row {
				display: flex;
				justify-content: space-between;
				margin-bottom: 10px;

				&.morning-courses {
					background: rgba(247, 102, 173, 0.05);
					border-radius: 12px;
					padding: 10px 5px;
				}

				&.afternoon-courses {
					background: rgba(247, 102, 173, 0.08);
					border-radius: 12px;
					padding: 10px 5px;
				}
			}

			.course-item {
				flex: 1;
				min-width: 0;
				margin: 0 5px;
				padding: 10px;
				background: white;
				border-radius: 8px;
				box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
				opacity: 0;
				animation: fadeInUp 0.5s forwards;
				display: flex;
				flex-direction: column;
				align-items: center;
				text-align: center;
				transition: all 0.3s ease;

				&:active {
					transform: scale(0.98);
				}

				.course-time {
					font-size: 12px;
					color: #888;
					margin-bottom: 6px;
				}

				.course-name {
					font-size: 15px;
					font-weight: 500;
					margin-bottom: 4px;
					color: #333;
				}

				.course-teacher {
					font-size: 12px;
					color: #666;
					margin-bottom: 2px;
				}

				.course-location {
					font-size: 11px;
					color: #999;
				}
			}
		}

		.current-course-indicator {
			margin-top: 12px;
			padding: 10px;
			background: rgba(247, 102, 173, 0.1);
			border-radius: 8px;
			display: flex;
			align-items: center;
			justify-content: center;
			font-size: 14px;
			color: #F766AD;

			uni-icons {
				margin-right: 6px;
			}
		}
	}
</style>